﻿using System.ComponentModel;
using System;

namespace DevExpress.CrmDemo.Win.Data {
    public class TeamMemberStat : INotifyPropertyChanged {
        #region Public members

        public int TeamMemberId {
            get { return _teamMemberId; }
            set {
                _teamMemberId = value;
                InvokePropertyChanged("TeamMemberId");
            }
        }

        public int Percent {
            get { return _percent; }
            set {
                _percent = value;
                InvokePropertyChanged("Percent");
            }
        }

        #endregion

        #region INotifyPropertyChanged implementation
        public event PropertyChangedEventHandler PropertyChanged;

        private void InvokePropertyChanged(string name) {
            PropertyChangedEventHandler handler = PropertyChanged;
            if(handler != null) handler(this, new PropertyChangedEventArgs(name));
        }
        #endregion

        #region Private data

        private int _teamMemberId;
        private int _percent;

        #endregion

    }

    public class TeamMemberStatList : BindingList<TeamMemberStat> { }
}
